package com.cnblogs.leizia.crm.workbench.service;

import com.cnblogs.leizia.crm.exception.ActivityException;
import com.cnblogs.leizia.crm.vo.PaginationVo;
import com.cnblogs.leizia.crm.workbench.domain.Activity;
import com.cnblogs.leizia.crm.workbench.domain.Tran;

import java.util.List;
import java.util.Map;

/**
 * @author leizi
 * @create 2021-02-16 12:42
 */
public interface ActivityService {
    /**
     * 添加市场活动信息
     *
     * @param activity
     * @return
     */
    boolean activitySave(Activity activity);

    /**
     * 分页获取市场活动列表
     *
     * @param activityPageMap 分页查询信息
     * @return
     */
    PaginationVo<Activity> activityPageList(Map<String, Object> activityPageMap);

    /**
     * 根据ids删除市场活动记录
     * (市场活动表与市场活动备注表关联删除记录)
     *
     * @param ids
     * @return
     */
    boolean activityDelete(String[] ids);

    /**
     * 根据id获取市场活动记录信息
     *
     * @param id
     * @return
     * @throws ActivityException
     */
    Activity editActivity(String id) throws ActivityException;

    /**
     * 根据id更新记录信息
     *
     * @param activity
     * @return
     * @throws ActivityException
     */
    boolean updateActivity(Activity activity) throws ActivityException;

    /**
     * 根据id获取市场活动详情
     *
     * @param id
     * @return
     * @throws ActivityException
     */
    Activity getDetail(String id) throws ActivityException;

    /**
     * 根据条件查询且排除已关联的市场活动
     *
     * @param name
     * @param activities
     * @return
     */
    List<Activity> getClueActivityList(String name, List<Activity> activities);

    /**
     * 线索转换
     *
     * @param clueId
     * @param tran
     * @return
     */
    boolean clueConvert(String clueId, Tran tran);
}
